import 'package:elephant_fish/model/beautiful_umber.dart';
import 'package:elephant_fish/util/size_util.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class BeautifulNumberCard extends StatelessWidget {
  final BeautifulNumber beautifulNumber;
  const BeautifulNumberCard({Key key, this.beautifulNumber}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;
    return InkWell(
       onTap: (){
         beautifulNumber.is_show ? print(beautifulNumber.id) : print(beautifulNumber.is_show);
        },
        child:SizedBox(
          child: Card(
            //取消卡片默认边距
            margin: EdgeInsets.all(3),
            color: Color(0xff0d0d0d),
            child: ClipRRect(
              borderRadius: BorderRadius.circular(10),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Stack(
                    children: [
                      Padding(padding: EdgeInsets.only(left: SizeUtil.px(30),top: SizeUtil.px(21)),
                        child: beautifulNumber.is_show ?Text(
                          beautifulNumber.number,style: TextStyle(fontSize: SizeUtil.px(32),color: Color(0xffbebebe)),
                        ) : Text(
                          beautifulNumber.number,style: TextStyle(fontSize: SizeUtil.px(32),color: Color(0xffffffff)),
                      ),
                      ),
                      Padding(padding: EdgeInsets.only(left: SizeUtil.px(30),top: SizeUtil.px(65),bottom: SizeUtil.px(21)),
                        child: beautifulNumber.is_show ? Text(
                          '金额：' + beautifulNumber.money + '元',style: TextStyle(fontSize: SizeUtil.px(32),color: Color(0xffbebebe)),
                        ) : Text(
                          '金额：' + beautifulNumber.money + '元',style: TextStyle(fontSize: SizeUtil.px(32),color: Color(0xffffffff)),
                        )
                      ),
                      Align(
                        alignment: Alignment.centerRight,
                        child: beautifulNumber.is_show ? Container(
                          alignment: Alignment(1,0),
                          height: SizeUtil.px(92),
                          child: Image.asset('assets/images/title_lianghang.png'),
                        ): Padding(padding: EdgeInsets.only(top:  SizeUtil.px(50)),
                          child: Text('点击购买 >',style: TextStyle(fontSize: SizeUtil.px(20),color: Color(0xffffffff)),
                        ),)
                      )
                    ],
                  )

                ],
              ),
            ),
          ),
        ));
  }

}
